﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace BlueLotus7.Eden.Web.Models
{
    public class ViewFlags
    {
        #region consts

        public const string CanEditFlag = "CanEdit";
        public const string ShowOKButtonFlag = "ShowOKBtn";

        #endregion

        protected Dictionary<string, bool> flags = new Dictionary<string, bool>();

        public bool this[string index]
        {
            get
            {
                bool result = false;
                if (!string.IsNullOrWhiteSpace(index))
                {
                    if (flags.ContainsKey(index))
                    {
                        result = flags[index];
                    }
                }

                return result;
            }
            set
            {
                if (!string.IsNullOrWhiteSpace(index))
                {
                    if (flags.ContainsKey(index))
                    {
                        flags[index] = value;
                    }
                    else
                    {
                        flags.Add(index, value);
                    }
                }
            }
        }
    }
}